package encapsulation;

public class Car {
	
	private  int   vinNumber;
    private String make;
	private String model;
	private String color;
	private int	   maxSpeed;
	private int    currentSpeed;
	private int    gear=1;
	private boolean started;
	private int		year;
   
     
     //Constructor Car
         
    
     Car( int   vinNumber,String make, String model, String color,int maxSpeed,int year)
     {
    	
    	 this.vinNumber = vinNumber;
    	 this.make = make;
    	 this.model = model;
    	 this.color = color;
    	 this.maxSpeed = maxSpeed;
    	 this.year = year;
    	    	 
     }
	
	
	//Start  Method() to know  the car status
    
	// Starting the car

	boolean  start()
			{		
		 			System.out.println("car has started true/false: " + started);
		 					 			
		 			if ( started == false)
		 			{
		 			  System.out.println("car has started : " + started);
		 			  started = true;
		 			    
		 			}
					return started;
			}

	
	// accelerate speed
	int accelerateSpeed(int howmuch)
	{
		int wishFulCurrentSpeed = currentSpeed + howmuch;		
	
	   if (wishFulCurrentSpeed >140 )
	   {
		   currentSpeed = maxSpeed;
		}
	   else
	   {
		   currentSpeed = wishFulCurrentSpeed;
	   }
	   return  currentSpeed;
	}	   
	
	
	//method to change color
	
	String changeColor()
			{
		
			 if (color =="Red")
			 {
		     color = "Black";
			 }
			return color;
			}
	
//Get the information for the variables
	
	 public int getVinNumber() {
		return vinNumber;
	}
	
	public String getMake() {
		return make;
	}

	public String getModel() {
		return model;
	}

	
	public int getGear() {
		return gear;
	}

	public void setGear(int gear) {
		this.gear = gear;
	}


	public boolean isStarted() {
		return started;
	}

	public void setStarted(boolean started) {
		this.started = started;
	}


	 public int getMaxSpeed()
	 {
		 return maxSpeed;
		 
	 }
	

	 public int getCurrentSpeed()
	 {
		 return currentSpeed;
	 }
	
	
	public String getCarColor()
	{
	return color;
	}


	public void setCarColor(String color) {
		this.color = color;
	}
	

		
}



